<template>
  <Node
    ref="root"
    title="发起人"
    :is-root="true"
    :content="content"
    @selected="$emit('selected')"
    @insertNode2="(type) => $emit('insertNode', type)"
    placeholder="所有人"
    header-bgc="#576a95"
    header-icon="el-icon-user-solid"
  />
</template>

<script setup name="RootNode" lang="ts">
import { computed, ref } from "vue";
import Node from '@/components/Process/node/nodes/Node.vue'

const props = defineProps({
  config: {
    type: Object,
    default: () => {
      return {};
    }
  }
});
const root=ref(null)
const config = ref(props.config);

const content = computed(() => {
  if (config.value.props && config.value.props.assignedUser.length > 0) {
    let texts: any[] = [];
    config.value.props.assignedUser.forEach((org: { name: any; }) => texts.push(org.name));
    return String(texts).replaceAll(",", "、");
  } else {
    return "所有人";
  }
});
defineExpose({root})
</script>

<style scoped></style>
